<template>
    <div class="right addVip">
		<div class="add_title tit">添加新会员</div>
		<table class="table" id="addVip">
			<tr>
				<td>会员昵称</td>
				<td><input type="text" v-model="name" class="form-control"></td>
			</tr>
			<tr>
				<td>会员邮箱</td>
				<td><input type="email" v-model="email" class="form-control"></td>
			</tr>
			<tr>
				<td>设置密码</td>
				<td><input type="password" v-model="psd" class="form-control"></td>
			</tr>
			<tr>
				<td>手机号码</td>
				<td><input type="tel" v-model="number" class="form-control"></td>
			</tr>
			<tr>
				<td></td>
				<td class="text-left">
					<button v-on:click="test" class="btn btn-default" data-toggle="modal" data-target="#my">添加新用户</button>
					<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
						<div class="modal-dialog" role="document">
							<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
								<h4 class="modal-title" id="myModalLabel">警告</h4>
							</div>
							<div class="modal-body">
								输入框不能为空
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
							</div>
							</div>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</div>
</template>
<script>
	import getTime from '../js/getTime'
	import storage from "../js/common"
    export default {
        data(){
            return{
                name:"",
                email:"",
                psd:"",
                number:"",
                date:"",
				flag:true
            }
        },
        methods:{
            test:function(){
                if(this.name!=""&&this.email!=""&&this.psd!=""&&this.number!=""){
					let that = this;
					let obje = {
						name:that.name,
                        email:that.email,
                        psd:that.psd,
                        number:that.number,
                        time:getTime()
					}
                    storage("data",obje);
                    location.hash = "#/vipList";
                }
            }
        }
    }
    
</script>
<style scoped lang="css">
	.add_title{
		margin-bottom:15px;
	}
	table{
		padding-top:10px;
	}
	tr{
		height:45px;
	}
	td .form-control{
		width:230px;
	}
	.add_title{
		background:url("../images/add_03.jpg") 5px 25px no-repeat;
	}
</style>